#include <stdio.h>

#include "matrix.h"

int main(void) {
    char filename[] = "./example.txt";
    char mat1_name[] = "./mat1.txt";
    Matrix *m;
    m = open_read_matrix(filename);
    write_matrix(stdout, m);

    puts("---------sub---------");
    size_t point[] = {0,1,1,1};
    Matrix *sub = get_sub(m, point, point+2);
    display(stdout, sub);
    *(get_item(sub, 0, 0)) = 10;
    display(stdout, sub);
    display(stdout, m);

    puts("---------dot---------");
    Matrix *mat1 = open_read_matrix(mat1_name);
    Matrix *tar = make_zeros(3, 3);
    display(stdout, mat1);
    dot(m, mat1, tar);
    display(stdout, tar);


    destroy_matrix(mat1);
    destroy_matrix(tar);
    destroy_matrix(sub);
    destroy_matrix(m);

    return EXIT_SUCCESS;
}
